home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Video Toaster 4.0
/
Video Toaster v4.0.iso
/
arexx
/
switcher
/
9650grab.rexx
next >
Wrap
OS/2 REXX Batch file
|
1993-12-13
|
3KB
|
133 lines
/* Grab frames on Sony9 EVO-9650 */
/* Set serial at 9600 8N1 */
/* Wed Nov 4 13:00:21 1992 */
arg timecode count name
StartupCmd="56DFC83240" /* DNR Mode */
cmdnum=1
NextFrame=x2c("2B")
OPTIONS RESULTS
TOASTERLIB="ToasterARexx.port"
if arg()=0 then do
say "USAGE: rx 9650Grab <Start Time Code> <# of frames> <name>"
exit
end
if count="" then count=10
if count>1000 then count=1000
if name="" then name=left(date(),6)
name=strip(name)
IF POS(TOASTERLIB , SHOW('Libraries')) = 0 THEN
IF ~ADDLIB(TOASTERLIB , 0) THEN x=Bummer(" Me No Find Toaster Library!")
if ~open(SerialOut,"SER:","a") then
do
say "Can't open serial port SER:."
exit
end
Switcher(TOSW) /* Go to Switcher screen */
/*writech(SerialOut,x2c(StartupCmd)) */
/*say freezeframe(timecode)*/
Switcher(M001)
Switcher(PDV1)
Switcher(TOSW) /* Go to Switcher screen */
Switcher(LVID) /* Set to live digital video */
time(reset)
do f=0 to count
Switcher(FVID) /* Freeze frame */
SaveNextFrame(name)
Switcher(LVID) /* Set to live digital video */
Switcher(M001)
writech(SerialOut,x2c(2b))
address command "wait 15 secs"
/* FreezeNext() */
end
Switcher(TOWB) /* Go to Workbench screen */
exit
/* ~~~~~~~~~~~~~~~~~~~~~ ROUTINES ~~~~~~~~~~~~~~~~~~~` */
/* Make code like hh:mm:ss:ff into sony style bytes */
MakeTC: PROCEDURE
arg TimeCode /* Conveniently, ASCII of the hex numbers are the numbers themselves */
return space(translate(TimeCode,'',':'))||'@'
FreezeNext: PROCEDURE
/* writech(SerialOut,x2c(dfc92b)) Freeze Off, advance frame */
address command "wait 3 secs"
/* writech(SerialOut,x2c(dfcd)) Freeze frame */
address command "wait 15 secs"
writech(SerialOut,x2c(dfca)) /* Output full frame mode */
return 1
FindFrame: PROCEDURE EXPOSE SerialOut
arg TimeCode
if TimeCode="" then return ""
cmd=x2c(df93)
cmd=cmd||MakeTC(TimeCode)
writech(SerialOut,cmd)
address command "wait 15 secs"
return cmd
FreezeFrame: PROCEDURE EXPOSE SerialOut
arg TimeCode
if TimeCode="" then return ""
writech(SerialOut,x2c(dfc92b)) /* Freeze Off, advance frame */
address command "wait 2 secs"
cmd=x2c(df93)
cmd=cmd||MakeTC(TimeCode)
writech(SerialOut,cmd)
address command "wait 15 secs"
writech(SerialOut,x2c(dfcd)) /* Freeze frame */
address command "wait 15 secs"
writech(SerialOut,x2c(dfca)) /* Output full frame mode */
return cmd
RecordFrame: PROCEDURE EXPOSE SerialOut
arg TimeCode
edit_preset_cmd=x2c(dfC0)||'240@'
writeln(SerialOut,edit_preset_cmd)
in_entry_cmd=x2c(de98)||MakeTC(TimeCode)
writeln(SerialOut,in_entry_cmd)
rec_dur_cmd=x2c(df92)||'0001@'
writeln(SerialOut,rec_dur_cmd)
address command "wait 20 secs"
return cmd
RecordNextFrame: PROCEDURE EXPOSE SerialOut
rec_dur_cmd=x2c(df92)||'0001@'
writeln(SerialOut,rec_dur_cmd)
address command "wait 15 secs"
return cmd
SaveNextFrame: Procedure
arg name
N=Switcher(STAT,KNUM) /* Get the current keypad number */
fs=N+1
do while Switcher(FMXI,fs) &fs~=N /* Is the frame already there? */
if fs=999 then fs=0 /* wrap around at last frame */
else fs=fs+1
end
if fs=N then t=10 /* got to starting frame without finding open fs */
else t=Switcher(FMSV,fs,name) /* Save frame */
say "Saved frame "name" in number "fs " at "time()
return t